﻿/*----------------------------------------------------------------
//  <copyright file="MapFromAttribute.cs" company="MicroCloud@151504200868">
//      Copyright © 2020-2024 MicroCloud Corporation, All rights reserved.
//  </copyright>
//  <site>https://gitee.com/chenmm123/microclouds</site>
//  <last-editor>cmm</last-editor>
//  <last-date>2024-01-03 10:04</last-date>
//----------------------------------------------------------------*/

namespace MicroCloud.Mapping
{
    #region "标注当前类型从源类型的Mapping映射关系"
    /// <summary>
    /// 标注当前类型从源类型的Mapping映射关系
    /// </summary>
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, Inherited = true, AllowMultiple = false)]
    public class MapFromAttribute : Attribute
    {
        #region "属性"
        #region "获取 源类型"
        /// <summary>
        /// 获取 源类型
        /// </summary>
        public Type[] SourceTypes { get; }
        #endregion

        #endregion

        #region "构造函数"
        #region "初始化一个当前类型从源类型的Mapping映射关系的新实例"
        /// <summary>
        /// 初始化一个当前类型从源类型的Mapping映射关系 <see cref="MapFromAttribute"/> 的新实例
        /// </summary>
        /// <param name="sourceTypes"></param>
        public MapFromAttribute(params Type[] sourceTypes)
        {
            Check.NotNull(sourceTypes, nameof(sourceTypes));
            SourceTypes = sourceTypes;
        }
        #endregion

        #endregion

    }
    #endregion

}
